package rhinestone.Model;
/**
 * Represents a staff. It extends Person and is hold in a StaffContainer.
 * 
 * @author Group 2
 * @version 2010.12.15
 */
public class Staff extends Person {
	public static final int CASHIER_RANK = 0;
	public static final int MANAGER_RANK = 1;
	public static final int DIY = 0;
	public static final int TIMBERYARD = 1;
	private int rank;
	private int workingPlace;

    /**
     * Constructor for objects of class Staff
     */

    public Staff(String name, String address, String cpr, String phone, int workingPlace, int rank)
    {
        super(name, address, cpr, phone);
		this.rank = rank;
		this.workingPlace = workingPlace;
    }

	/**
	 * Sets new rank for the employee.
	 *
	 * @param rank The rank to be set.
	 */
	public void setRank(int rank) {
		this.rank = rank;
	}

	/**
	 * @return The rank of the employee.
	 */
	public int getRank() {
		return rank;
	}

	public void setWorkingPlace(int workingPlace) {
		this.workingPlace = workingPlace;
	}

	public int getWorkingPlace() {
		return workingPlace;
	}

	/**
	 * Object representation for printing.
	 * No need to call it manually, it is called automatically
	 * whenever you put this object in System.out.println();
	 */
	@Override
	public String toString() {
		String output = "CPR: " + cpr;
		output += "\nName: " + name;
		output += "\nAddress: " + address;
		output += "\nPhone: " + phone;
		if(workingPlace == DIY)
			output += "\nWorking place: DIY";
		else if(workingPlace == TIMBERYARD)
			output += "\nWorking place: timberyard";
		if(rank == CASHIER_RANK)
			output += "\nRank: cashier";
		else if(rank == MANAGER_RANK)
			output += "\nRank: manager";
		return output;
	}
}
